package com.itany.book.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * Author:yaozhiyuan0117@163.com
 * Time:2019/12/29 19:39
 * Describe:
 * version:1.0
 */
public class MSNSender {
    // private static String MOBILE ="18860902313";
    // 短信模板 待写！
    private static String TPL_ID ="67040";
    // 变量名和变量值
    private static String TPL_VALUE ="%23code%23%3d";
    // 申请人的key 待写!
    private static String KEY ="eefb806d68ebe16694cc0083cc9f46f0";
    // 第三方接口地址
    private static String URL = "http://v.juhe.cn/sms/send";
    private static String DTYPE="json";

    public static void sendMsg(String tel, String code){
        Map<String, String> params = new HashMap<>();
        params.put("mobile",tel);
        params.put("tpl_id", TPL_ID);
        params.put("tpl_value",TPL_VALUE+code);
        params.put("key",KEY);
        params.put("dtype",DTYPE);
        HttpClientUtils.doPost(URL,params);
    }
}
